/*
 * Copyright 2019-2029 the original author or authors.
 * Copyright (c) 2021, 智乐兔 - zhiletu.com. All rights reserved.
 */
package com.zhiletu.collect.collect;

import com.zhiletu.collect.util.ScriptingAPI;

/**
 * @Title: ModelHandleArticleFormat.java
 * @Package com.zhiletu.collect.collect
 * @Description: 文章格式化处理，比如输出一个表格或者对行列格式的内容批量添加模板内容
 * @author zhiletu.com
 * @date 2021年2月5日
 * @version V1.0
 * @param <T>
 */
public class ModleHandleArticleFormat implements ModleHandle {

	/**
	 * <p>Title: 无参构造</p> 
	 * <p>Description: 必须实现无参构造，否则反射机制调用不到</p>  
	 */
	public ModleHandleArticleFormat() {
	}

	@Override
	public String handle(String source, String script, String funName) {
		String tempArt = null;
		try {
			tempArt = ScriptingAPI.invokeScript(script, funName, new Object[] { source });

		}
		catch (Exception e) {
			throw new RuntimeException(e);
		}

		return tempArt;
	}

}
